package com.ruoyi.binance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.binance.mapper.Binance30minAverageMapper;
import com.ruoyi.binance.domain.Binance30minAverage;
import com.ruoyi.binance.service.IBinance30minAverageService;

/**
 * 实时30分钟均价数据Service业务层处理
 * 
 * @author zq
 * @date 2025-08-07
 */
@Service
public class Binance30minAverageServiceImpl implements IBinance30minAverageService 
{
    @Autowired
    private Binance30minAverageMapper binance30minAverageMapper;

    /**
     * 查询实时30分钟均价数据
     * 
     * @param code 实时30分钟均价数据主键
     * @return 实时30分钟均价数据
     */
    @Override
    public Binance30minAverage selectBinance30minAverageByCode(String code)
    {
        return binance30minAverageMapper.selectBinance30minAverageByCode(code);
    }

    /**
     * 查询实时30分钟均价数据列表
     * 
     * @param binance30minAverage 实时30分钟均价数据
     * @return 实时30分钟均价数据
     */
    @Override
    public List<Binance30minAverage> selectBinance30minAverageList(Binance30minAverage binance30minAverage)
    {
        return binance30minAverageMapper.selectBinance30minAverageList(binance30minAverage);
    }

    /**
     * 新增实时30分钟均价数据
     * 
     * @param binance30minAverage 实时30分钟均价数据
     * @return 结果
     */
    @Override
    public int insertBinance30minAverage(Binance30minAverage binance30minAverage)
    {
        binance30minAverage.setCreateTime(DateUtils.getNowDate());
        return binance30minAverageMapper.insertBinance30minAverage(binance30minAverage);
    }

    /**
     * 修改实时30分钟均价数据
     * 
     * @param binance30minAverage 实时30分钟均价数据
     * @return 结果
     */
    @Override
    public int updateBinance30minAverage(Binance30minAverage binance30minAverage)
    {
        binance30minAverage.setUpdateTime(DateUtils.getNowDate());
        return binance30minAverageMapper.updateBinance30minAverage(binance30minAverage);
    }

    /**
     * 批量删除实时30分钟均价数据
     * 
     * @param codes 需要删除的实时30分钟均价数据主键
     * @return 结果
     */
    @Override
    public int deleteBinance30minAverageByCodes(String[] codes)
    {
        return binance30minAverageMapper.deleteBinance30minAverageByCodes(codes);
    }

    /**
     * 删除实时30分钟均价数据信息
     * 
     * @param code 实时30分钟均价数据主键
     * @return 结果
     */
    @Override
    public int deleteBinance30minAverageByCode(String code)
    {
        return binance30minAverageMapper.deleteBinance30minAverageByCode(code);
    }
}
